#include<iostream>
#include<functional>
using namespace std;
//void func(int a,int b,int c)
//{
//    cout<<a<<b<<c<<endl;
//}
//
//int main()
//{
//    function<void(int,int)> f1=bind(func,placeholders::_1,10,placeholders::_2);
//    f1(1,2);
//    return 0;
//}

template<class T>
class SmartPtr
{
public:
    SmartPtr(T* ptr):_ptr(ptr)
    {
      
    }
    ~SmartPtr()
    {
        delete[] _ptr;
        cout<<"~ delete[] _ptr";
    }
    T* _ptr;
};

double Division(int len,int time)
{
    if(time==0)
    {
        throw "除0错误";
    }
    else
    {
        return (double)len/time;
    }
}
void func()
{
    int* p1=new int[]{1,2,3};
    SmartPtr<int> sp(p1);
    int len,time;
    cin>>len>>time;
    cout<<Division(len, time)<<endl;
    delete p1;
}
int main()
{
    try
    {
        func();
    }
    catch(const char* str)
    {
        cout<<str<<endl;
    }
    catch(...)
    {
        cout<<"未知异常"<<endl;
    }
    return 0;
}
